<template>
  <div class="mt-4">
    <el-input
      v-model="input3"
      style="max-width: 600px"
      placeholder="请输入电影"
      class="input-with-select"
    >
      <template #append>
        <el-button :plain="true" :icon="Search" @click="search" />

      </template>
    </el-input>
  </div>
</template>

<script setup lang="ts">

import { ref } from 'vue'
import { Search } from '@element-plus/icons-vue'
import axios from 'axios'
import { ElMessage } from 'element-plus'


const input3 = ref('')

function search() {
  axios.get('/api/cx/getOneFile', {
    params: {
      name: input3.value
    },
    headers: {
      Authorization: localStorage.getItem('token')
    }
  }).then((res) => {
    if (res.data.code == 500) {

      ElMessage.error(res.data.film)
    } else {
      console.log(res.data)
      window.open('/pn/?pa=' + encodeURIComponent(input3.value), '_blank')
    }

  })
}

</script>


<style scoped>


/deep/ .el-input__inner {
  color: #c5c5c5;
}


:deep .el-input__wrapper {
  background-color: rgba(13, 16, 13, 0) !important;

}

:deep .el-input-group__append {
  background-color: rgba(0, 0, 0, 0) !important;

}

</style>